Journals
  Publication Years
  Keywords
Search within results Open Search
Please wait a minute...
For Selected: Toggle Thumbnails
Design and implementation of automatic C code parallelization based on JavaCC
LIU Youyao, YANG Pengcheng
Journal of Computer Applications    2016, 36 (9): 2422-2426.   DOI: 10.11772/j.issn.1001-9081.2016.09.2422
Abstract554)      PDF (872KB)(354)       Save
Aiming at the problem that a large amount of legacy code can not be reused, a new compilation tool was designed to convert the serial code of C into a hybrid parallel programming code based on MPI+OpenMP, which can reduce the development cost of parallel programming. First of all, by optimizing Java Compiler Compiler (JavaCC), a lexical and syntax analyzer which can parse the C language was implemented, then the source code analysis was conducted and the abstract syntax tree was generated. Secondly, according to the abstract syntax tree, the control dependence and data dependence of the source code were analyzed to produce the parallelizable statement block partitions. Thirdly, the object code was obtained according to the proposed parallel code generation method. Finally, the target code simulation environment was built based on Visual Studio 2010. The experimental results show that the tool can effectively achieve automatic parallelization of the serial code, and compared with the code written by hand, its speedup of the error is between 8.2% to 18.4%.
Reference | Related Articles | Metrics